package corp.edu.amadeus.utils.security;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import org.apache.log4j.Logger;
import java.math.BigInteger;

public class Encoder {

	private static Logger log = Logger.getLogger(Encoder.class);

    public static String encrypt(String texto, String algoritmo)
    	throws NoSuchAlgorithmException {
        byte[] textBytes = texto.getBytes();
        MessageDigest md = MessageDigest.getInstance(algoritmo);
        byte[] codigo = md.digest(textBytes);
        return new BigInteger(1,codigo).toString(16);
    }

}